<html><head><title>Select : EndSelect</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="5">Select : EndSelect</font></b></p>

<br><b>Syntax</b><blockquote><pre><font face="Courier New, Courier, mono"size="2"><b><font color="#3A3966">Select</font></b> &lt;expression1&gt;
  <b><font color="#3A3966">Case</font></b> &lt;expression&gt; [, &lt;expression&gt; [&lt;numeric expression&gt; To &lt;numeric expression&gt;]]
     ...
  [<b><font color="#3A3966">Case</font></b> &lt;expression&gt;]
     ...
  [<b><font color="#3A3966">Default</font></b>] 
     ...
<b><font color="#3A3966">EndSelect</font></b> 
</font></pre></blockquote>
<b>Description</b><br><blockquote>


<b><font color="#3A3966">Select</font></b> provides the ability to determine a quick choice. The program will execute the &lt;expression1&gt; and retain its' value in memory. 
It will then compare this value to all of the <b><font color="#3A3966">Case</font></b> &lt;expression&gt; values and if a given <b><font color="#3A3966">Case</font></b> &lt;expression&gt; value is true, 
it will then execute the corresponding code and quit the <b><font color="#3A3966">Select</font></b> structure. <b><font color="#3A3966">Case</font></b> supports multi-values and value ranges 
through the use of the optional <b><font color="#3A3966">To</font></b> keyword (numeric values only). If none of the <b><font color="#3A3966">Case</font></b> values are true, then the <b><font color="#3A3966">Default</font></b> 
code will be executed (if specified). 

<br>
<br>
Note: <b><font color="#3A3966">Select</font></b> will accept <a href="variables.html">floats</a> as &lt;expression1&gt; but will round them down to the nearest integer (comparisons 
will be done only with integer values). 


</blockquote><p><b>Example:</b> Simple example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  Value = 2
  
  <b><font color="#3A3966">Select</font></b> Value
    <b><font color="#3A3966">Case</font></b> 1
      <b><font color="#3A3966">Debug</font></b> &quot;Value = 1&quot;
      
    <b><font color="#3A3966">Case</font></b> 2 
      <b><font color="#3A3966">Debug</font></b> &quot;Value = 2&quot;
      
    <b><font color="#3A3966">Case</font></b> 20 
      <b><font color="#3A3966">Debug</font></b> &quot;Value = 20&quot;
      
    <b><font color="#3A3966">Default</font></b>
      <b><font color="#3A3966">Debug</font></b> &quot;I don't know&quot;
  <b><font color="#3A3966">EndSelect</font></b>
</font></pre>

</blockquote><p><b>Example:</b> Multicase and range example</p><blockquote>


<pre><font face="Courier New, Courier, mono"size="2">  Value = 2
  
  <b><font color="#3A3966">Select</font></b> Value
    <b><font color="#3A3966">Case</font></b> 1, 2, 3
      <b><font color="#3A3966">Debug</font></b> &quot;Value is 1, 2 or 3&quot;
      
    <b><font color="#3A3966">Case</font></b> 10 <b><font color="#3A3966">To</font></b> 20, 30, 40 <b><font color="#3A3966">To</font></b> 50
      <b><font color="#3A3966">Debug</font></b> &quot;Value is between 10 and 20, equal to 30 or between 40 and 50&quot;
      
    <b><font color="#3A3966">Default</font></b>
      <b><font color="#3A3966">Debug</font></b> &quot;I don't know&quot;
      
  <b><font color="#3A3966">EndSelect</font></b>
</font></pre>
</body></html>